-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding constraints on injection-witdrawal cumulation [ANT-1885] #2535
base: develop
Are you sure you want to change the base?
Adding constraints on injection-witdrawal cumulation [ANT-1885] #2535
Conversation
src/solver/optimisation/constraints/ShortTermStorageCumulation.cpp
Outdated
Show resolved
Hide resolved
...er/optimisation/include/antares/solver/optimisation/constraints/ShortTermStorageCumulation.h
Outdated
Show resolved
Hide resolved
if (!constraint.validate()) | ||
{ | ||
logs.error() << "Invalid constraint in section: " << section->name; | ||
logs.error() << constraint.getErrorMessage(); | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove getErrorMessage
by using a "status" for the return value
std::optional<std::string> AdditionalConstraint::validate();
if (auto errorMaybe = constraint.validate(); errorMaybe)
{
logs.error() << "Invalid constraint in section: " << section->name << errorMaybe.value();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or throw exceptions
Quality Gate passedIssues Measures |
No description provided.